/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.com.smart.hawk.controller.impl;

import co.com.smart.hawk.controller.HawkDepartamentosCtrl;
import co.com.smart.hawk.dto.DepartamentoDTO;
import co.com.smart.hawk.model.caller.DepartamentosCaller;
import co.com.smart.hawk.utilities.Utility.CallBackSmartHawk;
import java.util.List;
import javax.persistence.EntityManager;

/**
 *
 * @author Carlos Enaldo Ramos Hoyos
 * @fecha: 03/02/2017
 */
public class HawkDepartamentosCtrlImpl implements HawkDepartamentosCtrl{
    
    private EntityManager entityManager;
    private DepartamentosCaller departamentoCaller;
    
    public HawkDepartamentosCtrlImpl(){
        this(null);
    }
    
    public HawkDepartamentosCtrlImpl(EntityManager entityManager){
        this.entityManager = entityManager;
        departamentoCaller = new DepartamentosCaller();
    }

    @Override
    public void listarDepartamentos(CallBackSmartHawk<List<DepartamentoDTO>> callBack, DepartamentoDTO departamento) throws Throwable {
        callBack.endProcess(departamentoCaller.listarDepartamentos(departamento));
    } 
}
